package edu.gyc.hiseckill.model;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author ls
 * @since 2020-01-28
 */
@Data
public class UserOrder implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId("Id")
    private String Id;

    private Integer userId;

    private Integer itemId;


    private Integer promoId;
    /**
     * 商品购买时的价格，会变动冗余字段，若promoId不为空，则表示秒杀价格
     */
    private BigDecimal itemPrice;

    /**
     * 购买数量
     */
    private Integer amount;

    private BigDecimal totalPrice;


    public String getId() {
        return Id;
    }

    public void setId(String Id) {
        this.Id = Id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public BigDecimal getItemPrice() {
        return itemPrice;
    }

    public void setItemPrice(BigDecimal itemPrice) {
        this.itemPrice = itemPrice;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    @Override
    public String toString() {
        return "UserOrder{" +
                "Id='" + Id + '\'' +
                ", userId=" + userId +
                ", itemId=" + itemId +
                ", promoId=" + promoId +
                ", itemPrice=" + itemPrice +
                ", amount=" + amount +
                ", totalPrice=" + totalPrice +
                '}';
    }
}
